package com.echo.blog.business.blog.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.echo.blog.business.blog.model.BlogType;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 服务类
 * </p>
 *
 * @author chentl123
 * @since 2019-09-10
 */
public interface IBlogTypeService extends IService<BlogType> {

    /**
     * @return java.util.List
     * @author chentl
     * @description 获取博客分类列表
     * @date 2019/9/11 9:29
     * @params []
     * @since JDK 1.7
     */
    List<Map<String, Object>> getBloyTypeList();

    /**
     * @return java.util.List
     * @author chentl
     * @description 获取博客索引
     * @date 2019/9/16 15:40
     * @params [userId ，blogType]
     * @since JDK 1.7
     */
    BlogType getBlogTypeIndex(Integer userId, Integer blogType);

    /**
     * @return java.util.List
     * @author chentl
     * @description 获取个人博客类型列表
     * @date 2019/9/16 16:26
     * @params [userId]
     * @since JDK 1.7
     */
    List<BlogType> getBlogTypeList(Integer userId);

    /**
     * @return java.lang.Integer
     * @author chentl
     * @description 获取id最大值
     * @date 2019/9/17 11:01
     * @params []
     * @since JDK 1.7
     */
    Integer selectMaxId();

    /**
     * @return boolean
     * @author chentl
     * @description 插入一条blogType
     * @date 2019/9/17 11:09
     * @params [sortName, createby]
     * @since JDK 1.7
     */
    boolean insertBlogType(String sortName, Integer createby);

    /**
     * @author chentl
     * @description 校验重复文章类型
     * @date 2019/9/17 12:31
     * @params [name, userId]
     * @return java.lang.Integer
     * @since JDK 1.7
     */
    boolean validRepeat(String name, Integer userId);

}
